var proxyColumns=[{
	hidden: true,
    resizable: false,
	dataIndex: "inlayDiamondId"
}, {
    header: "钻托名称",
    align : 'center',
    dataIndex: "name"
}, {
    header: "钻托编号",
    align : 'center',
    dataIndex: "inlayBatch"
},  {
    header: "镶钻编号",
    align : 'center',
    dataIndex: "inlayDiaBatch"
}, {
    header: "类型",
    align : 'center',
    dataIndex: "type"
}, {
    header: "材质",
    align : 'center',
    dataIndex: "material"
}, {
    header: "价格",
    align : 'center',
    dataIndex: "price"
}, {
    header: "手寸",
    align : 'center',
    dataIndex: "hand"
}, {
    header: "刻字",
    align : 'center',
    dataIndex: "text"
}, {
    header: "工厂编号",
    align : 'center',
    dataIndex: "inlayFactoryBatch"
}, {
    header: "钻托所属",
    align : 'center',
    dataIndex: "cmpName"
},{
    header: "状态",
    dataIndex: "stateName"
}];


var expander = new Ext.grid.RowExpander({ 
        tpl : new Ext.XTemplate( 
        '<div class="detailData">', 
        '', 
        '</div>' 
        ) 
        }); 
expander.on("expand",function(expander,r,body,rowIndex){ 
  //查找 grid 
  window.testEle=body; 

  if (Ext.DomQuery.select("div.x-panel-bwrap",body).length==0){ 

//  	log.dir(r);
//  	var data=r.json[3]; 
  	
  	var gridModel=new Ext.grid.ColumnModel({
		  defaultSortable: false,
		  defaultWidth: 85,
		  columns:proxyColumns
	})
//	var cm = new Ext.grid.ColumnModel(proxyColumns); 
	
  	
     var store=new Ext.data.SimpleStore({ 
          fields:getFieldsFromColumns(proxyColumns),
          data:[]
         }); 
         
         var rd=Record_create_FromArray(r.data.proxy);
         store.insert(0,rd);
		var grid = new Ext.grid.GridPanel({ 
		    store:store, 
		    cm:gridModel, 
		    renderTo:Ext.DomQuery.select("div.detailData",body)[0], 
		    autoWidth:true, 
		    autoHeight:true,
		    listeners:{
				'mouseover' : function(e) {
					e.stopPropagation();	
				},
				'mouseout' : function(e) {
					e.stopPropagation();	
				}
			}
		}); 
		grid.afterMethod("processEvent", function(n, e) {
			e.stopPropagation();
		});
  
  } 
});